# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

package(default_visibility = ["//visibility:public"])

load("@rules_rust//rust:defs.bzl", "rust_proc_macro", "rust_test_suite")

filegroup(
    name = "all_srcs",
    srcs = glob(["**"]),
)

rust_proc_macro(
    name = "iceoryx2-bb-derive-macros",
    srcs = glob(["src/**/*.rs"]),
    deps = [
        "//iceoryx2-bb/elementary:iceoryx2-bb-elementary",
        "//iceoryx2-bb/elementary-traits:iceoryx2-bb-elementary-traits",
        "@crate_index//:proc-macro2",
        "@crate_index//:quote",
        "@crate_index//:syn",
    ],
)

rust_test_suite(
    name = "iceoryx2-bb-derive-macros-tests",
    srcs = glob(["tests/**/*.rs"]),
    deps = [
        "//iceoryx2-bb/elementary:iceoryx2-bb-elementary",
        "//iceoryx2-bb/elementary-traits:iceoryx2-bb-elementary-traits",
        "//iceoryx2-bb/testing:iceoryx2-bb-testing",
        "//iceoryx2-pal/testing:iceoryx2-pal-testing",
    ],
    proc_macro_deps = [
        ":iceoryx2-bb-derive-macros",
        "@crate_index//:generic-tests",
    ],
)
